﻿using System.Windows;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;
using WinAutomator.Library.InOut;
using System.Windows.Controls;
using WinAutomator.Library;
using GalaSoft.MvvmLight.Command;

namespace WinAutomator.ViewModel
{
    /// <summary>
    /// This class contains properties that the main View can data bind to.
    /// <para>
    /// See http://www.galasoft.ch/mvvm
    /// </para>
    /// </summary>
    public class MainViewModel : ViewModelBase
    {

        

        /// <summary>
        /// The <see cref="ButtonClick" /> property's name.
        /// </summary>
        public const string ButtonClickPropertyName = "ButtonClick";

        private bool _button = false;

        /// <summary>
        /// Sets and gets the ButtonClick property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public bool ButtonClick
        {
            get
            {
                return _button;
            }

            set
            {
                if (_button == value)
                {
                    return;
                }

                //RaisePropertyChanging(ButtonClickPropertyName);
                _button = value;
                RaisePropertyChanged(ButtonClickPropertyName);
            }
        }

        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {



            TestCommandPassParamRC = new RelayCommand(() => TestCommandPassParam2());
        }

        public RelayCommand TestCommandPassParamRC
        {
            get;
            private set;
        }

        private void TestCommandPassParam2()
        {
            Messenger.Default.Send(new object(), "RunWorkflow");
        }

        ////public override void Cleanup()
        ////{
        ////    // Clean up if needed

        ////    base.Cleanup();
        ////}
    }
}